package name.huzhenbo.java.patterns.strategy;

import java.util.Comparator;

public class LexicographicallyComparator implements Comparator<String> {
    private LexicographicallyComparator(){
    }

    public static Comparator getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public int compare(String s1, String s2) {
        return s1.compareTo(s2);
    }

    private static class SingletonHolder {
        static final Comparator INSTANCE = new LexicographicallyComparator();
    }
}
